<script>
    layui.use(['layer'], function () {
        var layer = layui.layer
            $ = layui.jquery;
        $("#auth").click(function () {
            layer.prompt({
                formType: 1,
                value: '',
                title: '请输入权限号',
            }, function(value, index, elem){
                $.getJSON('{{route('auth')}}', {'auth': value}, function (rev) {
                    if(rev.status === 0) {
                        layer.msg('设置成功');
                        window.location.reload();
                    } else {
                        layer.msg(rev.msg);
                    }
                });
                layer.close(index);
            });
        });
        $("#logout").click(function () {
            $.getJSON('{{route('logout')}}', function (rev) {
                layer.msg(rev.msg);
                window.location.reload();
            })
        });
    });
</script>